<?php
/**
 * ===============================================
 * 版权所有 2019-2050 青岛铁锤科技有限公司，并保留所有权利。
 * 网站地址: http://www.huaxianling.com
 * ===============================================
 * Author: Rag Hu
 * Created Time: 2019/7/10 10:53
 * Modified Time: 2019/7/10 10:53
 * Version: 2.0
 */

namespace App\Modules\Inventory\Validators;


use Flower\Core\Repository\Contracts\ValidatorInterface;
use Flower\Core\Repository\Validator\LaravelValidator;

class SalePurchaseValidator extends LaravelValidator
{
    protected $rules = [
        ValidatorInterface::RULE_CREATE => [
            'store_id' => 'required|numeric',
            'goods_id' => 'required|numeric',
            'goods_name' => 'required|between:1,20',
            'type' => 'required|numeric',
            'source' => 'required|numeric',
            'count' => 'required|numeric'
        ]
    ];
    protected $messages = [
        'store_id.required' => '缺少店铺id',
        'store_id.numeric' => '店铺id格式错误',

        'goods_id.required' => '请选择商品id',
        'goods_id.numeric' => '商品id格式错误',


        'goods_name.required' => '请填写商品标题',
        'goods_name.between' => '商品标题最多只能填写20个字符',

        'count.required' => '请填写进货量',
        'type.required' => '缺少类型',
        'source.required' => '缺少场景值'
    ];
}